package com.bum.game.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.bum.game.util.RequestUtil;

public class PageController extends AbstractController {

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String viewName = RequestUtil.getPath(request).replace(".html", "");
		
		if (StringUtils.isBlank(viewName)) {
			viewName = "index";
		}
		
		ModelAndView mv = new ModelAndView(viewName);
		return mv;
	}

}
